<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>异常构造函数</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.exception.html">Exception</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="exception.getmessage.html">Exception::getMessage</a></div>
 <div class="up"><a href="class.exception.html">Exception</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="exception.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Exception::__construct</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0)</p><p class="refpurpose"><span class="refname">Exception::__construct</span> &mdash; <span class="dc-title">异常构造函数</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-exception.construct-description">
  <h3 class="title">说明</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Exception::__construct()</strong></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$message</code><span class="initializer"> = &quot;&quot;</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$code</code><span class="initializer"> = 0</span></span>
   [, <span class="methodparam"><span class="type"><a href="class.exception.html" class="type Exception">Exception</a></span> <code class="parameter">$previous</code><span class="initializer"> = <strong><code>NULL</code></strong></span></span>
  ]]] )</div>

  <p class="para rdfs-comment">
   异常构造函数。
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-exception.construct-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">message</code></em></dt>

     <dd>

      <p class="para">
       抛出的异常消息内容。
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">code</code></em></dt>

     <dd>

      <p class="para">
       异常代码。
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">previous</code></em></dt>

     <dd>

      <p class="para">
       异常链中的前一个异常。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 changelog" id="refsect1-exception.construct-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>5.3.0</td>
       <td>
        增加<em><code class="parameter">previous</code></em>参数。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-exception.construct-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    The <em><code class="parameter">message</code></em> is <em class="emphasis">NOT</em> 
    binary safe.
   </p>
  </p></blockquote>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.exception.html">Exception</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="exception.getmessage.html">Exception::getMessage</a></div>
 <div class="up"><a href="class.exception.html">Exception</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
